import http from '@/utils/http'

/**
 * 获取订单信息
 * @returns
 */
export const getMemberOrderPreAPI = () => {
  return http({
    url: '/member/order/pre'
  })
}

/**
 *  提交订单
 * @param {*} data
 * @returns
 */
export const postMemberOrderAPI = data => {
  return http({
    url: '/member/order',
    method: 'POST',
    data
  })
}

/**
 * 立即购买
 * @param {*} data
 * @returns
 */
export const getMemberOrderPreNowAPI = data => {
  return http({
    url: '/member/order/pre/now',
    data
  })
}

/**
 * 获取订单详情
 * @returns
 */
export const getMemberOrderDetailAPI = id => {
  return http({ url: `/member/order/${id}` })
}

/**
 *获取微信支付参数
 * @param {*} data
 * @returns
 */
export const getPayWxPayMiniPayAPI = data => {
  return http({
    url: '/pay/wxPay/miniPay',
    data
  })
}
